package streamApi;

import java.util.Arrays;
import java.util.List;

/**
 * Stream中间操作的映射
 */
public class Demo03 {
    public static void main(String[] args) {
        List<Integer> integers = Arrays.asList(1, 2, 3, 4, 5);

        //将集合中所有的偶数+1之后打印
        integers.stream().filter(t -> t % 2 == 0).map(t -> t + 1).forEach(System.out::println);
        System.out.println();

        List<PatientTemperatureVo> patientList = Demo01.getPatientList();
        //打印2020-01-27的所有人的名字和体温
        patientList.stream().filter(t -> t.getDateStr().contains("2020-01-27"))
                .map(t -> t.getName() + ":" + t.getTemperature())
                .forEach(System.out::println);
        System.out.println();
    }
}
